package org.ms.springboot.aop.exception;

import org.ms.springboot.aop.model.ResultMessage;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 统一异常处理
 *
 * @author lry
 */
@RestControllerAdvice
public class ExceptionController {

    @ExceptionHandler({Exception.class})
    private ResultMessage handler(CheckException e) {
        return new ResultMessage(e.getCode(), e.getMsg(), null);
    }

}
